#ifndef __PHYSICS__SHAPES__INCLUDED__HH__
#define __PHYSICS__SHAPES__INCLUDED__HH__

#include <Newton.h>
#include <Ogre.h>
#include "LitPhysicsPrereqs.h"

namespace Lit
{
	namespace Physics
	{
		/*********************
		/*		BASE SHAPE
		/*********************/
		class LIT_API CollisionShape
		{
		protected:
			Matrix mInitialMatrix;
			int		mId;
			ShapeType	mType;
		public:
			CollisionShape( const Matrix & initial, ShapeType type, int id );
			virtual ~CollisionShape();
		
			InertialMatrix calculateInertialMatrix( float mass, _CollisionPtr col ) const ;
		
			int shapeId() const;
			const Matrix& initialMatrix() const;
			ShapeType shapeType() const;

			virtual _CollisionPtr createShape( _WorldPtr world ) = 0;
			virtual void destroyShape( _WorldPtr world, _CollisionPtr col );
		};

		typedef Lit::RefPtr<CollisionShape> CollisionShapePtr;
		/*********************
		/*		NULL
		/*********************/
		class LIT_API NullShape : public CollisionShape
		{
		public:
			NullShape(  );
			~NullShape();

			_CollisionPtr createShape( _WorldPtr world );
		};
	
		/*********************
		/*		PLANE
		/*********************/
		class LIT_API PlaneShape : public CollisionShape
		{
			Lit::AABB mBox;
		public:
			PlaneShape( const Lit::AABB& box, int shapeId, const Matrix & transfo );
			~PlaneShape();

			_CollisionPtr createShape( _WorldPtr world );
		};

		/*********************
		/*		BOX
		/*********************/
		class LIT_API BoxShape : public CollisionShape
		{
			Lit::AABB mBox;
		public:
			BoxShape( const Lit::AABB& box, int shapeId, const Matrix & transfo );
			~BoxShape();

			_CollisionPtr createShape( _WorldPtr world );
		};
	
		/*********************
		/*		SPHERE
		/*********************/
		class LIT_API SphereShape : public CollisionShape
		{
			Lit::AABB mAABB;
		public:
			SphereShape( const Lit::AABB& box, int shapeId, const Matrix & transfo );
			~SphereShape();

			_CollisionPtr createShape( _WorldPtr world );
		};
	};
};

#endif